<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditAreaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditAreaLabel_idarea}" for="idarea" />
                    <h:inputText id="idarea" value="#{areaController.selected.idarea}" title="#{bundle.EditAreaTitle_idarea}" required="true" requiredMessage="#{bundle.EditAreaRequiredMessage_idarea}"/>
                    <h:outputLabel value="#{bundle.EditAreaLabel_nombre}" for="nombre" />
                    <h:inputText id="nombre" value="#{areaController.selected.nombre}" title="#{bundle.EditAreaTitle_nombre}" />
                    <h:outputLabel value="#{bundle.EditAreaLabel_siglas}" for="siglas" />
                    <h:inputText id="siglas" value="#{areaController.selected.siglas}" title="#{bundle.EditAreaTitle_siglas}" />
                    <h:outputLabel value="#{bundle.EditAreaLabel_descripcion}" for="descripcion" />
                    <h:inputText id="descripcion" value="#{areaController.selected.descripcion}" title="#{bundle.EditAreaTitle_descripcion}" />
                    <h:outputLabel value="#{bundle.EditAreaLabel_estado}" for="estado" />
                    <h:selectOneMenu id="estado" value="#{areaController.selected.estado}" title="#{bundle.EditAreaTitle_estado}" required="true" requiredMessage="#{bundle.EditAreaRequiredMessage_estado}">
                        <f:selectItems value="#{estadoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{areaController.update}" value="#{bundle.EditAreaSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditAreaViewLink}"/>
                <br />
                <h:commandLink action="#{areaController.prepareList}" value="#{bundle.EditAreaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditAreaIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
